#define _CRT_SECURE_NO_WARNINGS 1
#include"vector.h"
#include<string>


void test1()
{
	bit::vector<int> v1;
	v1.pushback(1);
	v1.pushback(2);
	v1.pushback(3);
	v1.pushback(4);
	for (int i = 0; i < v1.size(); i++)
	{
		cout << v1[i] << " ";
	}
	cout << endl;
	v1.insert(v1.end(), 5);
	for (int i = 0; i < v1.size(); i++)
	{
		cout << v1[i] << " ";
	}
	cout << endl;
	v1.insert(v1.end(), 6);
	v1.erase(v1.begin());
	for (int i = 0; i < v1.size(); i++)
	{
		cout << v1[i] << " ";
	}
	cout << endl;
}
void test2()
{
	bit::vector<int> v1;
	v1.pushback(1);
	v1.pushback(2);
	v1.pushback(3);
	v1.pushback(4);
	bit::vector<int>::iterator it = v1.begin() + 1;
	v1.insert(it, 0);
	for (int i = 0; i < v1.size(); i++)
	{
		cout << v1[i] << " ";
	}
	cout << endl;
	cout << *it;
	
}


void test3()
{
	bit::vector<int> v1;
	v1.pushback(1);
	v1.pushback(2);
	v1.pushback(3);
	v1.pushback(4);
	bit::vector<int> v2(v1);
	for (int i = 0; i < v2.size(); i++)
	{
		cout << v2[i] << " ";
	}
	cout << endl;

	bit::vector<int> v3;
	v3 = v2;
	for (int i = 0; i < v2.size(); i++)
	{
		cout << v2[i] << " ";
	}
	cout << endl;
}

void test4()
{
	string s ("hello world");
	bit::vector<int> v1(s.begin(), s.end());
	for (int i = 0; i < v1.size(); i++)
	{
		cout << v1[i] << " ";
	}
	cout << endl;

	bit::vector<int> v3;
	v3.pushback(1);
	v3.pushback(2);
	v3.pushback(3);
	v3.pushback(4);
	bit::vector<int> v2(v3.begin(), v3.end());
	for (int i = 0; i < v2.size(); i++)
	{
		cout << v2[i] << " ";
	}
	cout << endl;
}

void test5()
{
	
	bit::vector<string> v1(5, "xxx");
	for (int i = 0; i < v1.size(); i++)
	{
		cout << v1[i] << " ";
	}
	cout << endl;
	
	bit::vector<int> v2(5, 1); 
	for (int i = 0; i < v2.size(); i++)
	{
		cout << v2[i] << " ";
	}
	cout << endl;
}

int main()
{
	test5();
	return 0;
}